package com.example.demo.Controller;

import com.example.demo.dao.ProfessionRepository;
import com.example.demo.domain.Profession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProfessionController {
    @Autowired
    ProfessionRepository professionRepository;

    @RequestMapping("/saveprofession")
    public Profession save(String name){

        Profession u = professionRepository.save(new Profession(name));

        return u;

    }
}
